home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 29
/
Volume 29 - JOGO DISK .iso
/
Games
/
little_soldiers.swf
/
scripts
/
frame_2
/
DoAction.as
Wrap
Text File
|
2006-11-29
|
2KB
|
64 lines
function createBorder(clip, depth, w, h)
{
var _loc5_ = clip.createEmptyMovieClip("border",depth);
var _loc1_ = 0;
while(_loc1_ < h)
{
var _loc4_ = _loc5_.attachMovie("borderTiles","b_" + _loc1_ + "_0",_loc1_ * w);
_loc4_._y = _loc1_ * th;
if(_loc1_ == 0)
{
_loc4_.gotoAndStop(1);
var _loc2_ = 1;
while(_loc2_ < w - 1)
{
_loc4_ = _loc5_.attachMovie("borderTiles","b_" + _loc1_ + "_" + _loc2_,_loc1_ * w + _loc2_);
_loc4_._y = _loc1_ * th;
_loc4_._x = (_loc2_ - 1) * tw;
_loc4_.gotoAndStop(2);
_loc2_ = _loc2_ + 1;
}
}
else if(_loc1_ == h - 1)
{
_loc4_.gotoAndStop(6);
_loc2_ = 1;
while(_loc2_ < w - 1)
{
_loc4_ = _loc5_.attachMovie("borderTiles","b_" + _loc1_ + "_" + _loc2_,_loc1_ * w + _loc2_);
_loc4_._y = _loc1_ * th;
_loc4_._x = _loc2_ * tw;
_loc4_.gotoAndStop(7);
_loc2_ = _loc2_ + 1;
}
}
else
{
_loc4_.gotoAndStop(4);
}
_loc4_ = _loc5_.attachMovie("borderTiles","b_" + _loc1_ + "_" + (w - 1),_loc1_ * w + (w - 1));
_loc4_._y = _loc1_ * th;
_loc4_._x = (w - 1) * tw;
if(_loc1_ == 0)
{
_loc4_.gotoAndStop(3);
}
else if(_loc1_ == h - 1)
{
_loc4_.gotoAndStop(8);
}
else
{
_loc4_.gotoAndStop(5);
}
_loc1_ = _loc1_ + 1;
}
return _loc5_;
}
tw = 32;
th = 32;
stw = 14;
sth = 11;
border = createBorder(_root,1,stw + 2,sth + 3);
border._x = border._y = -16;